package dgut_test2.demo;

import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SuppressWarnings("unused")
class CustomCommandLineRunner implements CommandLineRunner{

    Environment env;

    public CustomCommandLineRunner(Environment env){
        this.env=env;
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("Spring Boot自动配装的CommandLineRunner测试。");

        System.out.println("测试随机生成字符串".concat(Objects.requireNonNull(env.getProperty("random."))));
    }
}
